//
//  NSColorAdditions.m
//  MapEdit
//
//  Created by Steven Canfield on 13/06/07.
//  Copyright 2007 __MyCompanyName__. All rights reserved.
//

#import "NSColorAdditions.h"


@implementation NSColor (NSColorAdditions)
+ (id)colorWithNormalizedRed:(int)red green:(int)green blue:(int)blue
{
	return [NSColor colorWithCalibratedRed:(float)red / 255.0 green:(float)green / 255.0 blue:(float)blue / 255.0 alpha:1.0];
}

+ (NSColor *)tealColor {
	return [NSColor colorWithCalibratedRed:34.0f / 255.0f green:171.0f / 255.0f blue:148.0f / 255.0f alpha:1.0f];
}

- (NSColor *)inverseColor {
	NSColor * rgb = [self colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
	CGFloat red = [rgb redComponent];
	CGFloat green = [rgb greenComponent];
	CGFloat blue = [rgb blueComponent];
	return [NSColor colorWithCalibratedRed:1.0f - red green:1.0f - green blue:1.0f - blue alpha:1.0f];
}

@end
